package com.carpedil.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.carpedil.demo.po.UserDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/** @author Administrator */
@Repository
public interface UserDetailMapper extends BaseMapper<UserDetail> {
  /**
   * getUserDetailById
   *
   * @param fkUserDetailId fkId
   * @return UserDetail
   */
  @Select(
      "SELECT ud.*"
          + " FROM user_detail ud "
          + " INNER JOIN users u on ud.user_detail_id = u.fk_user_detail_id "
          + " where user_detail_id = #{fkUserDetailId}")
  @ResultMap("com.carpedil.demo.dao.UserDetailMapper.detailMap")
  UserDetail getUserDetailById(@Param("fkUserDetailId") Integer fkUserDetailId);
}
